/** 
 * Project Name:ZhiWeiCateringManagementSystem 
 * File Name:PayOrderRecordAction.java 
 * Package Name:cn.ccit.servers 
 * Date:2016年11月5日下午7:18:38 
 * Copyright (c) 2016, 120026139@qq.com All Rights Reserved. 
 * 
 */

package cn.ccit.action;

import java.util.List;
import java.util.Map;

import com.opensymphony.xwork2.ModelDriven;

import cn.ccit.entites.record.PayOrderRecord;
import cn.ccit.iservers.IPayOrderRecordServers;
import cn.ccit.model.BaseModel;
import cn.ccit.servers.PayOrderRecordServers;

/**
 * ClassName:PayOrderRecordAction <br/>
 * Function: 退菜记录表 <br/>
 * Reason: <br/>
 * Date: 2016年11月5日 下午7:18:38 <br/>
 * 
 * @author Administrator
 * @version
 * @since JDK 1.6
 * @see
 */
public class PayOrderRecordAction extends BaseRecordAction implements
		ModelDriven<PayOrderRecord> {

	/**
	 * serialVersionUID:(版本号).
	 * 
	 * @since JDK 1.6
	 */
	private static final long serialVersionUID = 1L;
	private IPayOrderRecordServers iOrderRecordServers = new PayOrderRecordServers();
	private PayOrderRecord PayOrder = new PayOrderRecord();

	@Override
	public String addData() {
		sendJsonData(iOrderRecordServers.addPayOrderRecord(PayOrder),
				new BaseModel<PayOrderRecord>());
		return super.addData();
	}

	@Override
	public String removeData() {
		sendJsonData(iOrderRecordServers.removePayOrderRecord(PayOrder),
				new BaseModel<PayOrderRecord>());
		return super.removeData();
	}

	@Override
	public String changeDataInfo() {
		sendJsonData(iOrderRecordServers.changePayOrderRecordInfo(PayOrder),
				new BaseModel<PayOrderRecord>());
		return super.changeDataInfo();
	}

	@Override
	public String getDataList() {
		sendJsonDataList(
				iOrderRecordServers.getSomePayOrderRecords(startId, limit),
				new BaseModel<List<PayOrderRecord>>());
		return super.getDataList();
	}

	@Override
	public String sreachDataById() {
		sendJsonDataMap(
				iOrderRecordServers.searchPayOrderRecordByID(PayOrder.getId()),
				new BaseModel<Map<String, Object>>());
		return super.sreachDataById();
	}

	@Override
	public PayOrderRecord getModel() {
		return PayOrder;
	}

	@Override
	public String searchDataListByYear() {
		sendJsonDataList(
				iOrderRecordServers.searchPayOrderRecordByYear(PayOrder
						.getOrderYear()), new BaseModel<List<PayOrderRecord>>());
		return super.searchDataListByYear();
	}

	@Override
	public String searchDataListByMonth() {
		sendJsonDataList(
				iOrderRecordServers.searchPayOrderRecordByMonth(PayOrder
						.getOrderMonth()),
				new BaseModel<List<PayOrderRecord>>());
		return super.searchDataListByMonth();
	}

	@Override
	public String searchDataListByDate() {
		sendJsonDataList(
				iOrderRecordServers.searchPayOrderRecordByDate(PayOrder
						.getOrderDate()), new BaseModel<List<PayOrderRecord>>());
		return super.searchDataListByDate();
	}

}
